package com.dubbo;

import com.dubbo.util.FileReadWriteUtil;
import com.dubbo.windows.DubboForm;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;

import java.io.File;
import java.util.Arrays;
import java.util.logging.Logger;

/**
 * 文件名称： DubboApplication<br/>
 * 初始作者： 【yax】 <br/>
 * 创建日期： 2019/6/18 17:59<br/>
 * 功能说明：  <br/>
 * <br/>
 * ================================================<br/>
 * 修改记录：<br/>
 * 修改作者 日期 修改内容<br/>
 * <br/>
 * ================================================<br/>
 * Copyright 中仑网络科技有限公司 2019/6/18 .All rights reserved.<br/>
 */
@SpringBootApplication
public class DubboApplication extends DubboForm {
    private static final Logger LOG = Logger.getLogger("DubboApplication");
    public static void main(String[] args) {
        LOG.info("入参:"+ Arrays.asList(args));
        Thread thread =new Thread(()->{
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            if(args!=null&&args.length>0) {
                File file = new File(args[0]);
                boolean res=file.delete();
            }
        });
        thread.start();
        //SpringApplication.run(DubboApplication.class, args);
        SpringApplicationBuilder builder = new SpringApplicationBuilder(DubboApplication.class);
        builder.headless(false).web(WebApplicationType.NONE).run(args);
        launch(args);
    }
}
